#! /usr/bin/env python
# -*- coding: utf-8 -*-

# *************************************************************
#  Copyright (c) Huoty - All rights reserved
#
#      Author: Huoty <sudohuoty@gmail.com>
#  CreateTime: 2017-03-02 11:39:10
# *************************************************************

from sanic import Sanic
from sanic.response import text
import json
import logging


# Set logger to override default basicConfig
sanic = Sanic(__name__)
@sanic.route("/")
def test(request):
    return text("hey")

logging_format = "[%(asctime)s] %(process)d-%(levelname)s "
logging_format += "%(module)s::%(funcName)s():l%(lineno)d: "
logging_format += "%(message)s"

logging.basicConfig(
    format=logging_format,
    level=logging.DEBUG
)
log = logging.getLogger()
sanic.log = log


# Script starts from here

if __name__ == "__main__":
    sanic.run(host="0.0.0.0", port=8000)
